package com.nexus.all.model;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import java.time.LocalDateTime;

/**
 * 请求日志实体类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@TableName("nexus_request_log")
public class RequestLog {

    public static final LambdaQueryWrapper<RequestLog> gw() {
        return new LambdaQueryWrapper<>();
    }


    /**
     * id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * ip
     */
    @TableField(value = "request_ip")
    private String requestIp;

    /**
     * 请求方式
     */
    @TableField(value = "request_method")
    private String requestMethod;

    /**
     * 请求方法
     */
    @TableField(value = "request_uri")
    private String requestUri;

    /**
     * 参数
     */
    @TableField(value = "request_param")
    private String requestParam;

    /**
     * 请求协议
     */
    @TableField(value = "request_protocol")
    private String requestProtocol;

    /**
     * 响应状态
     */
    @TableField(value = "response_status")
    private Integer responseStatus;

    /**
     * 响应耗时/ms
     */
    @TableField(value = "response_time")
    private Integer responseTime;

    /**
     * 日志traceId
     */
    @TableField(value = "response_trace_id")
    private String responseTraceId;

    /**
     * 笔记发布时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 笔记修改时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 是否删除
     */
    @TableLogic
    @TableField(value = "is_deleted")
    private Byte isDeleted;


    /**
     * -------------------------------------------------
     * 上面字段由工具自动生成，请在下面添加扩充字段
     * -------------------------------------------------
     */


}